// #pragma once
#ifndef EDITTEXTBOX_H
#define EDITTEXTBOX_H
#ifdef __cplusplus
extern "C"
{
#endif
	typedef struct
	{
		string str; // line content
		unsigned char width; //line width
		unsigned char len;	// string len
		unsigned char cap;	// capability
	} EditTextLine_t;
	typedef EditTextLine_t* EditTextLine;

	typedef struct
	{
		Li_List lines; /// List<EditTextLine_t>
		//Li_List widths;// List<car>
		int disp_from;				//disp from a line
		int cursor_line, cursor_at; // cursor is shine at a line
		int statues;
		Gem gem;						// to view the size
		int cursor_pos_x, cursor_pos_y; // cursor shine position
		int last_max_x, last_max_y;//about drawing
		int cursor_style;				// 0(not shine), 1(shine), -1(invisable)
	} EditTextBoxView_t;
	typedef EditTextBoxView_t* EditTextBoxView;


	extern const char* cmd_vim_annotation;
	extern JUI editBox_ui;

	void editTextBoxView_file_init(void);
	void editTextBox_test_demo(void);;

	void edit_lose_focus(JUI );
	// void editText_let_lose_focus(void(*callback_when_reobtain)());

	int cmd_vim(int n, char* arg[]);
	// keyboard interface
	JUI editText_kbf_typed(char* msg);
	JUI editText_kbf_control_event(char* id);

	void editTextBoxView_addChar(EditTextBoxView view, char c);
	void editTextBoxView_addString(EditTextBoxView view, char* s);
	int editTextBoxView_delete(EditTextBoxView view);


#ifdef __cplusplus
}
#endif
#endif // EDITTEXTBOX_H
